﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Diagnostics;
using AppToolkit.WPF.UI;

namespace AppToolkit.WPF.Tests.UI.FolderBrowser
{
    /// <summary>
    /// Interaction logic for FolderBrowserTestWindow.xaml
    /// </summary>
    public partial class FolderBrowserTestWindow : Window
    {
        public FolderBrowserTestWindow()
        {
            InitializeComponent();
        }

        public MultiThreadedFolderBrowser Browser { get { return _browser; } }


        private void OnGetSelectedFolder(object sender, RoutedEventArgs e)
        {
            _selectedPath.Text = _browser.SelectedFolder;
        }

        private void OnSetSelectedFolder(object sender, RoutedEventArgs e)
        {
            Stopwatch sw = Stopwatch.StartNew();
            
            _browser.SelectedFolder = _selectedPath.Text;
            
            sw.Stop();
            this._StatusBlock.Text = string.Format("Time elapsed:  {0:N}", sw.ElapsedMilliseconds);
        }
    }
}
